// 角色行为规范接口（所有游戏角色的通用操作手册）|| Character Behavior Interface (Common rulebook for all game characters)
#ifndef ICHARACTER_HH
#define ICHARACTER_HH

#include <string>    // 文字处理工具 || Text handling tools
#include <vector>    // 动态列表容器 || Dynamic list container

struct Item;  // 物品原型声明（类似物品身份证）|| Item prototype declaration (like item ID card)

// 角色操作手册（所有角色必须遵守的契约）|| Character Operation Manual (Contract all characters must follow)
class ICharacter {
public:
    // ====== 角色生命周期规则 ====== || ====== Character Lifecycle Rules ======
    virtual ~ICharacter() = default;  // 安全销毁角色（角色退场协议）|| Safe character destruction (exit protocol)

    // ====== 角色状态查询 ====== || ====== Character Status Checks ======
    virtual bool isAlive() const = 0;           // 是否存活（生命值>0检测）|| Alive check (HP >0 verification)
    virtual std::string getName() const = 0;    // 获取角色名称 || Get character name
    virtual std::string getDescription() const = 0; // 获取角色描述 || Get character bio
    virtual unsigned getHealth() const = 0;      // 获取当前生命值 || Get current HP
    virtual unsigned getAttack() const = 0;      // 获取攻击力数值 || Get attack power
    virtual unsigned getDefense() const = 0;    // 获取防御力数值 || Get defense power

    // ====== 战斗动作规范 ====== || ====== Combat Action Specifications ======
    virtual bool takeDamage(unsigned damage) = 0; // 承受伤害（返回是否存活）|| Take damage (return survival status)
    virtual bool attack(ICharacter& target) = 0;  // 攻击其他角色（返回是否成功）|| Attack others (return success status)

    // ====== 角色信息展示 ====== || ====== Character Information Display ======
    virtual std::string toString() const = 0;    // 生成角色状态报告 || Generate status report
    virtual void display() const = 0;            // 展示角色完整信息 || Show full character profile

    // ====== 物品管理规范 ====== || ====== Inventory Management Rules ======
    virtual void addToInventory(Item* item) = 0;   // 添加物品到背包 || Add item to backpack
    virtual void displayInventory() const = 0;    // 展示背包内容列表 || Show backpack contents
};

// 结束接口保护 || End of interface protection
#endif // ICHARACTER_HH